<?php 
/**
	Author: Gustavo Palacios
	Author: Fernando Rodas

	Project: EPS, Ciencias y Sistemas, USAC. 2014-2015	

	CLASE QUE CONTIENE TODAS LAS FUNCIONES NECESARIAS PARA LA CONSTRUCCION 
	DE LAS DISTINTAS SECCIONES DE LAS PAGINAS

*/
include_once("dbMng.php");
	class Funciones_2 extends DataBaseManager{

	/**
		Constructor
	*/
		function __construct(){
		
	}

	/**
		Funcion para obtener todos los imports de librerias de javascript necesarios en la pagina
	*/
		function getJavascriptImports(){
			
		}
		
	/**
		Funcion para obtener todos los imports de librerias CSS necesarias para la pagina.	
	*/
		function getCssImports(){
			
			echo '<link rel="stylesheet" href="' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) . '\css\jquery.mobile-1.4.3.min.css">';
			echo '<link rel="stylesheet" href="' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) . '\css\jqm-demos.css">';
		}

	/**
		Funcion para construir el menu superior y lateral
	*/
		function getMenu($TituloHeader,$carpeta){
			echo '	<!-- Menu -->
			<div data-role="header" data-theme="b" style="position:fixed; width:100%;">
				<h1>F.A.S.T. ' . $TituloHeader . '</h1>
				<a href="#left-panel" data-theme="d" data-icon="arrow-r" data-iconpos="notext" data-shadow="false" data-iconshadow="false" class="ui-icon-nodisc">Open left panel</a>						
			</div>

			<div data-role="panel" id="left-panel" data-theme="b">
				<ul data-role="listview">
					<li data-icon="back"><a href="#" data-rel="close">Close</a></li>
					<li> External panel</li>
					<li><a href="' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) . "\\" . $carpeta .'\home.php" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-star">Home</a></li>
					<li><a href="#" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-star">Favoritos</a></li>
					<li> <a href="#" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-location">PDA\'s</a> 
						<ul data-role="listview">
							<li> External panel</li>
							<li> External panel</li>
							<li> External panel</li>
						</ul>
					</li>
				</ul>			
			</div><!-- /Menu -->';
					// echo $_SERVER['DOCUMENT_ROOT'];

		}
		
		function getHeaderPagina() {
			echo '
			!
			<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
			<img align="left" src="img/cema.PNG" width=\'5%\' />
			<div class="container">	
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">	
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.php">CEMA</a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="nosotros.php">Acerca de Nosotros</a>
                    </li>
                    <li>
                        <a href="#">Carreras</a>
                    </li>
                    <li>
                        <a href="#">Categorias</a>
                    </li>
					 <li align="right">
                        <a href="#">Contactanos</a>
                    </li>
                </ul>
				<ul class="nav navbar-nav navbar-right">
				 <li>
                        <a href="login">Administrador</a>
                    </li>
					</ul>
            </div>
            <!-- /.navbar-collapse -->
			</div>
			<!-- /.container -->
			</nav>';
		
		}
		
		function headerAdmin($nombrePag, $titulo, $categoria, $pagActual ) {
		
			session_start();
			if (!isset($_SESSION["Usuario"])){
				header("location: ../login");
			}
			else {
			echo '<head>
					<meta charset="UTF-8">
					<title>'.$nombrePag.'</title>
					<meta content=\'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\' name=\'viewport\'>
					<!-- bootstrap 3.0.2 -->
					<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
					<!-- font Awesome -->
					<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
					<!-- Ionicons -->
					<link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />
					<!-- Theme style -->
					<link href="css/AdminLTE.css" rel="stylesheet" type="text/css" />

					<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
					<!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->
					<!--[if lt IE 9]>
					<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
					<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
					<![endif]-->
				</head>
				<link rel="icon" type="image/png" href="../../img/icono.PNG" />
			<body class="skin-blue">
				<!-- header logo: style can be found in header.less -->
				<header class="header">
				<a href="index.php" class="logo">
					<!-- Add the class icon to your logo image or logo icon to add the margining -->
						<img src="img/cema.PNG" width=\'40%\'  ></img>
				</a>
				<!-- Header Navbar: style can be found in header.less -->
				<nav class="navbar navbar-static-top" role="navigation">
					<!-- Sidebar toggle button-->
					<a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>
					<div class="navbar-right">
						<ul class="nav navbar-nav">
                        
                       
							<!-- User Account: style can be found in dropdown.less -->
							<li class="dropdown user user-menu">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">
									<i class="glyphicon glyphicon-user"></i>
									<span>'.$_SESSION["Usuario"] .'<i class="caret"></i></span>
								</a>
								<ul class="dropdown-menu">
									<!-- User image -->
									<li class="user-header bg-light-blue">
										<img src="img/avatar3.PNG" class="img-circle" alt="User Image" />
										<p>'
											.$_SESSION["Usuario"].'
										<small>Administrador</small>
										</p>
									</li>
                      
									<!-- Menu Footer-->
									<li class="user-footer">
                                   
										<div class="pull-right">
											<button onclick="cerrar_sesion()" class="btn btn-default btn-flat">Cerrar Sesion</button>
											
											<script language="JavaScript" type="text/javascript">
											
												var paginicio="../login";
												function irinicio() 
												{
													location.href=paginicio;
												}
												
												function cerrar_sesion() {
												
													var fd = new FormData();
													fd.append("tipo", "62");
													$.ajax({
													url: "clases/Intermedio.php",
													type: "POST",
													data:  fd,
													contentType: false,
													cache: false,
													processData:false,
													success: function(){ 	
													setTimeout ("irinicio()", 0);
													},
													error: function(){} 	        
													});
												
												}
												
											</script>
											
										</div>
									</li>
								</ul>
							</li>
						</ul>
					</div>
				</nav>
			</header>
			
';
			}
		}
		
		//////////////////////////////////////////////////////////////////INICIO DE HEADER PARA LA PAGINA CEMA/////////////////////////////////////////////////////////////////
		
		function headerPagina($titulo,$numero) {
		
			echo '<head> <meta charset="utf-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<meta name="viewport" content="width=device-width, initial-scale=1">
			<meta name="description" content="">
			<meta name="author" content="">
<!-- jQuery 2.0.2 -->
        <script src="js/jquery.min.js"></script>
			<title>'.$titulo.'</title>

			<!-- Bootstrap Core CSS -->
			<link href="css/bootstrap.min.css" rel="stylesheet">

			<!-- Custom CSS -->
			<link href="css/modern-business.css" rel="stylesheet">

			<!-- Custom Fonts -->
			<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
			<link href="css/navbar-inverse.css" rel="stylesheet" type="text/css">
			<link href="css/botones.css" rel="stylesheet">
	
			<link href="css/site.css" rel="stylesheet" type="text/css" />
	

			<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
			<!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->
			<!--[if lt IE 9]>
				<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
				<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
			<![endif]-->

			</head>
			<link rel="icon" type="image/png" href="../../img/icono.PNG" />
			<body>

			<!-- Navigation -->
			<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
		
				<div class="container">
					<!-- Brand and toggle get grouped for better mobile display -->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						</button>
					<a class="navbar-brand" href="index.php">Inicio</a>
				
					</div>
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li '; 
					if($numero == 1) {
					echo'class="dropdown active"';
					} else {
					echo'class="dropdown"';
					}
					echo'>
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">Acerca de Nosotros<b class="caret"></b></a>
                        <ul class="dropdown-menu">
							<li>
                                <a href="historia.php">Historia</a>
                            </li>
                            <li>
                                <a href="misionyvision.php">Misión y Visión</a>
                            </li>
							<li>
                                <a href="contacto.php">Contactenos</a>
                            </li>
						</ul>
                    </li>
                    <li '; 
					if($numero == 2) {
					echo'class="active"';
					}
					echo'>
						<a href="carreras.php">Carreras</a>
                    </li>
                    <li '; 
					if($numero == 3) {
					echo'class="active"';
					}
					echo '>
                        <a href="productos.php">Productos</a>
                    </li>
					<li>
                        <a href="Aula/index.php">Aula</a>
                    
					<li> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li>
					<li>
					<img src="img/cema.PNG" width="75px" />
					</li>
					<li>
					&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					</li>
					<li>
					 <a href="login"><span class="glyphicon glyphicon-log-in"></span> Ingresar</a>
					</li>
                </ul>
				
				</div>
				<!-- /.navbar-collapse -->
				</div>
				
				<!-- /.container -->
			</nav>';
		
		}
		
		//////////////////////////////////////////////////////////////////FIN DE HEADER PARA LA PAGINA CEMA/////////////////////////////////////////////////////////////////

	/**
		Funcion para construir el footer de cada pagina.
	 */
		function getFooter(){
			echo '	<div data-role="footer" data-theme="a">
			<h4>Visi&oacute;n Mundial Guatemala,';
				echo date("Y"); 
				echo '	<img src="img/logo-fit.PNG" style="width:76px; height:25px; padding-left:10px;"/></h4>
			</div><!-- /footer -->';

		}
		
		////////////////////////////////////////////////////////////////INICIO DE FOOTER PARA LA PAGINA CEMA ///////////////////////////////////////////////////////////////////
		
		function footerPagina(){
		
			echo' <!-- Footer -->
        <div class="container">

				<hr>

				<!-- Footer -->
				<footer>
					<div class="row">
						<div class="col-lg-12">
						<center>
							<p>Copyright &copy; Centro de Estudios del Mar y Acuicultura (CEMA) 2014</p>
							<p><img src="img/cema.PNG" width=\'10%\'></img></p>			
			
							<button class="btn bg-light-blue btn-circle boton-azul"><i class="fa fa-facebook"></i></button>
							<button class="btn bg-aqua btn-circle boton-celeste"><i class="fa fa-twitter"></i></button>
							<button class="btn bg-red btn-circle boton-rojo"><i class="fa fa-google-plus"></i></button>
						</center>
					
						</div>
					</div>
				</footer>

		</div>';
		
		}
		
		////////////////////////////////////////////////////////////////FIN DE FOOTER PARA LA PAGINA CEMA ///////////////////////////////////////////////////////////////////
		
		function getFooterPagina(){
			echo '<div class="container">

				<hr>

				<!-- Footer -->
				<footer>
					<div class="row">
						<div class="col-lg-12">
						<center>
							<p>Copyright &copy; Centro de Estudios del Mar y Acuicultura (CEMA) -2014</p>
							<p><img src="img/cema.PNG" width=\'10%\'></img></p>			
			
							<button class="btn bg-light-blue btn-circle boton-azul"><i class="fa fa-facebook"></i></button>
							<button class="btn bg-aqua btn-circle boton-celeste"><i class="fa fa-twitter"></i></button>
							<button class="btn bg-red btn-circle boton-rojo"><i class="fa fa-google-plus"></i></button>
						</center>
					
						</div>
					</div>
				</footer>

				</div>';
		
		}
		
		function footerAdmin() {
			echo '<div class="footer">
					<div class="container">
		
					<center>
						<p>Copyright &copy; Centro de Estudios del Mar y Acuicultura (CEMA) -2014</p>
						<p><img src="img/cema.PNG" width=\'5%\'></img></p>	
						<button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>
						<button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>
						<button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>			
					</center>
					</div>
				</div>';
		}
		function headerNoticia($titulo) {
		
			echo '<head> <meta charset="utf-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<meta name="viewport" content="width=device-width, initial-scale=1">
			<meta name="description" content="">
			<meta name="author" content="">
<!-- jQuery 2.0.2 -->
        <script src="js/jquery.min.js"></script>
			<title>'.$titulo.'</title>

			<!-- Bootstrap Core CSS -->
			<link href="css/bootstrap.min.css" rel="stylesheet">

			<!-- Custom CSS -->
			<link href="css/modern-business.css" rel="stylesheet">

			<!-- Custom Fonts -->
			<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
			<link href="css/navbar-inverse.css" rel="stylesheet" type="text/css">
			<link href="css/botones.css" rel="stylesheet">
	
			<link href="css/site.css" rel="stylesheet" type="text/css" />
	

			<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
			<!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->
			<!--[if lt IE 9]>
				<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
				<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
			<![endif]-->

			</head>

			<body>

			<!-- Navigation -->
			<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
		
				<div class="container">
					<!-- Brand and toggle get grouped for better mobile display -->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						</button>
					<a class="navbar-brand" href="#"  onclick="window.close();">Cerrar </a>
				
					</div>
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                  
					<li> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li>
					<li>
					<img src="img/cema.PNG" width="75px" />
					</li>
                </ul>
				</div>
				<!-- /.navbar-collapse -->
				</div>
				<!-- /.container -->
			</nav>';
		
		}
		
	}
	?>